1. Field of the Invention
The present invention relates to a digital signal encoding method and apparatus, and more particularly, to a digital signal encoding method and apparatus using a plurality of lookup tables generated according to characteristics of input signals, select one lookup table among the plurality of lookup tables according to an input signal, and adaptively allocate the number of bits per frequency band from the selected lookup table.
2. Description of the Related Art
Digital transmission is much less sensitive to surrounding noise than analog transmission. As such, sound quality in the digital audio transmission is very good and the audio transmission can be reproduced very clearly. However, according to the increase of a data amount to be transmitted, various problems, such as an increase of a required memory capacity and a transmission line capacity, are caused.
To solve these problems, a data compression technology is needed. In the case of audio data, when original sound is compressed, transmitted, and reproduced, the reproduced sound should be almost or the same as the original sound. For this, a relatively small amount of information has to be transmitted.
A psychoacoustic model is typically used for audio signal encoding. By using a masking effect and a critical band of acoustic characteristics, even though an audio signal is encoded with a smaller number of bits than an original sound signal, sound quality having almost the same level as the original sound can be obtained by removing signals which people cannot hear, encoding only necessary signals, and allocating bits to the encoded signals.
Here, the masking effect indicates an effect that people cannot perceive a particular audio signal(s) even though they hear the audio signal because of a signal masking of another signal due to mutual interference among audio signals in a critical band. The critical band is a kind of unit used for people to discriminate sound frequencies and is typically divided into 24 bands. Since a bandwidth in a higher frequency is getting larger with a log scale, a person cannot easily discriminate a higher frequency signal from a lower frequency signal.
To allocate bits using the acoustic characteristics, a signal-to-noise ratio (SNR) and a signal-to-mask ratio (SMR) are obtained, and a mask-to-noise ratio (MNR) must be calculated from the SNR and the SMR. Here, a mask level indicates a minimum signal that people cannot perceive even though they hear. Therefore, bits do not have to be allocated for signals below the mask level.
After the MNR is obtained, bits are repeatedly allocated based on the MNR. However, a lot of computing time is needed for obtaining the MNR, and this means that real-time delay in an encoder is large. Accordingly, reducing the complexity of the necessary computations is important.
FIG. 1 is a block diagram of a conventional digital signal encoding apparatus using a psychoacoustic model in the MPEG-1 standard. Referring to FIG. 1, the apparatus includes a frequency mapping unit 100, a psychoacoustic model 110, a bit allocator 120, a quantizer 130, and a bitstream generator 140.
The frequency mapping unit 100 converts an input signal in the time domain into signals in predetermined frequency bands using a band resolution filter. The psychoacoustic model 110 is a part in which the complexity of the required computations is largest in the apparatus and calculates and outputs an SMR, which is a standard for bit allocation per frequency band. The SMR value is calculated according to the following series of operations. First, an audio signal in the time domain is converted into a signal in a frequency domain using a fast Fourier transform (FFT). Second, the sound pressure level of each band is calculated as shown in Equation 1.SPL=MAX{power,20 log(scf×32768)}dB  Equation 1
Third, an absolute masking threshold value is calculated. Fourth, tonal and non-tonal sound components of the audio signal are determined. Fifth, a masker is determined. Sixth, each masking threshold value is calculated. Seventh, an entire masking threshold value is calculated. Eighth, a minimum masking threshold value of each band is calculated. Finally, the SMR value of each band is calculated.
The bit allocator 120 obtains a bit allocation amount of each band by repeatedly performing the following series of operations based on the SMR values received from the psychoacoustic model 110. First, the number of bits initially allocated to each band is set to 0. Second, an MNR value of each band is obtained. Here, the MNR value is obtained by subtracting an SMR value from an SNR value. Third, the number of allocated bits of a band having a minimum MNR value among MNR values obtained for bands increases by 1. Finally, if the number of bits required for each band is not satisfied, the second and third operations are repeated for the unsatisfied bands.
The quantizer 130 quantizes the input signal according to the following series of operations. First, X is a value obtained by dividing a sample in each band by a scale factor. Second, A*X+B (here, A and B are values in a predetermined table) is calculated. Third, bits as many as the number of allocated bits obtained in a bit allocating process are obtained from the calculated values. Finally, a most significant bit (MSB) is inversed.
The bitstream generator 140 generates a bitstream using the quantized input signal.
As described above, the conventional digital signal encoding apparatus using a psychoacoustic model needs nine procedures to obtain the SMR values. Accordingly, the complexity of the necessary computations is large, which increases execution time. Also, since the MNR values are calculated using the SMR values and a bit allocating loop is repeatedly performed based on the MNR values, a time delay is also generated in this process.
FIG. 2 is a block diagram of a digital signal encoding apparatus using one lookup table. The apparatus uses a conventional digital signal encoding apparatus using a psychoacoustic model, as described in earlier work product, U.S. Pat. No. 5,864,802, also assigned to the same assignee of this application. Referring to FIG. 2, the apparatus includes a frequency mapping unit 200, a lookup table 210, an allocated bit number extractor 220, a quantizer 230, and a bitstream generator 240.
The frequency mapping unit 200 converts an input signal in the time domain into signals in predetermined frequency bands using a band resolution filter. The lookup table 210 stores numbers of allocated bits for encoding frequency bands in addresses corresponding to characteristics of the frequency bands.
The allocated bit number extractor 220 calculates an address value of each frequency band of the input signal and extracts the number of allocated bits of each address having the calculated address value from the lookup table 210. The quantizer 230 quantizes the input signal using the number of bits allocated to each frequency band. The bitstream generator 240 generates a bitstream using the quantized input signal.
As described above, by extracting the number of allocated bits of each frequency band stored in a lookup table and using the numbers of allocated bits for encoding, the conventional digital signal encoding apparatus using one lookup table can prevent the complex computations and time delay generated by using the psychoacoustic model. However, since input signals having different characteristics are encoded using the same lookup table, adaptive encoding according to characteristics of input signals is limited.